﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BOSS.Domain.Security;

namespace BOSS.Service.Security
{
    /// <summary>
    /// 角色服务接口
    /// </summary>
    public interface IRoleService : IEntityService<Role, int>
    {
        /// <summary>
        /// 查找指派给指定角色的权限组（静态权限）
        /// </summary>
        /// <param name="role"></param>
        /// <returns></returns>
        PrivilegeGroup GetAssignedPrivileges(Role role);

        /// <summary>
        /// 设置指派给指定角色的权限组
        /// </summary>
        /// <param name="role"></param>
        /// <param name="privileges"></param>
        void SetAssignedPrivileges(Role role, PrivilegeGroup privileges);

        /// <summary>
        /// 查看拥有指定权限的角色集合
        /// </summary>
        /// <param name="privilegeName"></param>
        /// <returns></returns>
        IDictionary<Role, PermissionType> SelectPermissions(string privilegeName);
    }
}
